package array;

import java.util.ArrayList;


public final  class EMp implements Comparable<EMp>{
		final private String name;
		final private String addres;
		final private int age;
		final ArrayList lst = new ArrayList();	
		
		public ArrayList getLst() {
			return new ArrayList(lst);
//			return lst;
		}

		public EMp(String name, String address) {
			this.name = name;
			this.addres =address;
			this.age=0;
		}
		
		public EMp(String name, String address, int age) {
			this.name = name;
			this.addres =address;
			this.age=age;
		}
		
		
		
		public void print()
		{
			String abc = null;
//			EMp emp = new EMp();
			String str = findDOB();
			System.out.println(name+" "+addres+" "+age	+" "+abc);
			
		}
		
		public static int count = 0;
		
		public static void checkCounter()
		{
			count++;
			System.out.println(count);
		}

		private String findDOB() {
			return "abcd";
		}

		public String getName() {
			return name;
		}

		

		public String getAddres() {
			return addres;
		}

		
		public int getAge() {
			return age;
		}

		@Override
		public String toString() {
		return	"{"+name+"  "+addres+ " " +age+"}";
		}

		@Override
		public int compareTo(EMp o) {
//			return age - o.age;
			
			int j = name.compareTo(o.name);
			if(j==0)
			{
				return age - o.age;
			}else{
				return j;
			}
			
		}
		
		

	
}
